export const menuTab = [
  {
    title: "取消数据",
    key: "1",
  },
  {
    title: "确认数据",
    key: "2",
  },
];
let STATUS_LIST = [];
let STATUS_LISTCycle = [];


export const updateStatusList = (newStatusList) => {
  STATUS_LIST = [...newStatusList];

};

export const updateStatusListCycle = (newStatusList) => {
  STATUS_LISTCycle = [...newStatusList];

};


export const getStatusList = () => STATUS_LIST;
export const getStatusListCycle = () => STATUS_LISTCycle;
export const listdata = [
  {
    id: "1",
    no: "JDX63321",
    status: "WAIT_FINISH",
    deviceName: "设备点检记录",
    deviceNo: "0000141",
    beginTime: "2020-06-01",
    submitTime: " 2020-09-23",
    totalTime: "10",
    result: "合格",
    classes: "白班",
    executor: "王小明",
  },
  {
    id: "2",
    status: "WAIT_FINISH",
    deviceName: "设备点检记录2",
    deviceNo: "0000141",
    beginTime: "2020-06-01",
    submitTime: " 2020-09-23",
    totalTime: "10",
    result: "合格",
    classes: "白班",
    executor: "王小明",
  },
];


const getcolor = (status) => {
  if (status == "WAIT_FINISH" || status == "CANCEL_TO_BE_CONFIRMED") {
    return "WAIT_FINISH";
  } else if (status == "PROCESSING" || status == "REPAIRING") {
    return "PROCESSING";
  } else if (status == "REPAIRED_TO_BE_CONFIRMED") {
    return "REPAIRED_TO_BE_CONFIRMED";
  }
};

export const listFields = {
  title: {
    label: "单据号",
    value: "no",
  },
  children: [

    {
      label: "计划名称",
      value: "name",
      
    },
    {
      label: "计划类型",
      value: "type",
      statusList: () => getStatusList(),
      statusColor: getcolor,
    },
    {
      label: "班次",
      value: "shiftType",
    },
    {
      label: "设备名称",
      value: "fixedAssetsName",
    },
    {
      label: "周期类型",
      value: "cycleType",
      statusList: () => getStatusListCycle(),
      statusColor: getcolor,
    },
    {
      label: "周期",
      value: "cycleNum",
      
    },
    {
      label: "是否维护子项",
      value: "isMaintainItem",
    },
    {
      label: "修改原因",
      value: "modifyReason",
    },
    {
      label: "创建人",
      value: "createUsername",
    },
  ],
};
